/*
 * @Description: loop_pose订阅，loop_pose包装成PoseWithCovarianceStamped
 * @Author: Sang Hao
 * @Date: 2021-10-24 14:58:55
 * @LastEditTime: 2021-10-27 11:46:38
 * @LastEditors: Sang Hao
 */

#ifndef LIDAR_SLAM_SUBSCRIBER_LOOP_POSE_SUBSCRIBER_HPP_
#define LIDAR_SLAM_SUBSCRIBER_LOOP_POSE_SUBSCRIBER_HPP_

#include <deque>
#include <ros/ros.h>
#include <geometry_msgs/PoseWithCovarianceStamped.h>

#include "lidar_slam/sensor_data/loop_pose.hpp"

namespace lidar_slam {
class LoopPoseSubscriber {
private:
	/* data */
	ros::NodeHandle nh_;
	ros::Subscriber subscriber_;

	std::deque<LoopPose> new_loop_pose_;
private:
	void msg_callback(const geometry_msgs::PoseWithCovarianceStampedConstPtr& loop_pose_msg_ptr);
public:
	LoopPoseSubscriber(ros::NodeHandle& nh, std::string topic_name, size_t buff_size);
	LoopPoseSubscriber() = default;
	void ParseData(std::deque<LoopPose>& loop_pose_buff);
};
}

#endif